#!/bin/bash

PIDFILE=/var/vcap/sys/run/job_3_with_post_deploy_script.pid

case $1 in

  start)
    echo $$ > $PIDFILE

    while true; do
      echo "job_3_with_post_deploy_script is running"
      sleep 1
    done
    ;;

  stop)
    tail -1 $PIDFILE | xargs kill

    rm -f $PIDFILE
    ;;

  *)
    echo "Usage: job_3_with_post_deploy_script_ctl {start|stop}"
    ;;
esac

exit 0
